package com.xd.service.admin.XTGLY.impl;

import com.xd.Dto.PageQueryDTOBase;
import com.xd.Mapper.ProductMapper;
import com.xd.Result.PageResult;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xd.service.admin.XTGLY.CatergoryProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CatergoryProductServiceImpl implements CatergoryProductService {
    @Autowired
    ProductMapper productMapper;
    @Override
    public PageResult getCatergory(PageQueryDTOBase pageQueryDTOBase) {
        PageHelper.startPage(pageQueryDTOBase.getPage(),pageQueryDTOBase.getPageSize());
        Page page =productMapper.getCatergory(pageQueryDTOBase);
        return new PageResult(page.getTotal(),page.getResult());

    }
}
